package com.mk.common.util;

import java.util.Scanner;

import org.junit.Test;

public class ScannerDemo
{
	
	@Test
	public void test1() {
		Scanner scanner = new Scanner(System.in);
		System.out.println("请输入......");
		
		stop:
		while(true) {
			String str = scanner.nextLine();
			if("exit".equals(str))
				break stop;
			
			System.out.println("控制台输出: "+str);
		}
		//关闭
		scanner.close();
	}
	
	
}